/* SECTION CATEGORY */
section.l-section-cat {
  grid-column: 1/7;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Блок шапки раздела */
.l-section-cat-header {
  width: 100%;
  background: #fff;
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid #e8eef8;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(10, 31, 68, 0.06);
  color: #111827;
}

.l-section-cat-title {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.l-section-cat-title-ic {
  font-size: 32px;
  color: #007bff;
}

.l-section-cat-title h1 {
  max-width: 685px;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  margin: 0;
}

/* Описание */
.l-section-cat-desc {
  font-size: 16px;
  line-height: 1.7;
  margin-top: 10px;
  text-align: justify;
  text-indent: 2em;
  color: #111827;
}

/* Контейнер действий */
.l-section-cat-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* База кнопок: единый стиль */
.l-section-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e8eef8;
  background: #f8fafc;
  color: #111827;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease, border-color 0.2s ease;
  user-select: none;
  line-height: 1;
  min-height: 36px;
}

.l-section-cat-btn:hover {
  background: #f1f5f9;
}

.l-section-cat-btn:active {
  transform: translateY(1px) scale(0.98);
}

.l-section-cat-btn:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

.l-section-cat-btn--ghost {
  background: transparent;
}

/* Выпадающее меню «Поделиться» (ниже кнопки) */
.l-section-cat-share {
  position: relative;
}

.l-section-cat-share__menu[hidden] {
  display: none !important;
}

.l-section-cat-share__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #e8eef8;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.18);
  padding: 8px;
  z-index: 999;
}

/* Единый вид пунктов меню (и для <a>, и для <button>) */
.l-section-cat-share__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-radius: 8px;
}

.l-section-cat-share__item:hover {
  background: #f3f6fb;
}

.l-section-cat-share__item:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* Блокировка прокрутки под модалкой */
html.is-modal-open {
  overflow: hidden;
}

/* Модалка */
.l-section-cat-modal[hidden] {
  display: none !important;
}

.l-section-cat-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
}

/* Бэкдроп */
.l-section-cat-modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
}

/* Карточка модалки */
.l-section-cat-modal__card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  width: 100%;
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eef8;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.25);
  padding: 16px;
}

.l-section-cat-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.l-section-cat-modal__close {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
}

.l-section-cat-modal__close:hover {
  background: #f8fafc;
}

.l-section-cat-form__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0;
}

.l-section-cat-form select,
.l-section-cat-form textarea {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.l-section-cat-form select:invalid {
  color: #9ca3af;
}

.l-section-cat-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Тосты */
.report-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #16a34a;
  color: #fff;
  padding: 1em 1.2em;
  border-radius: 6px;
  font-size: 0.95em;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 100200;
}

.report-toast.visible {
  opacity: 1;
  pointer-events: auto;
}

.report-toast--error {
  background: #dc2626;
}

.report-toast--warning {
  background: #f59e0b;
}

.report-toast--success {
  background: #16a34a;
}

@media (max-width: 600px) {
  .report-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

.l-section-cat-content {
  width: 100%;
  background: rgba(255, 255, 255, 1);
  padding: 40px 20px 40px 20px;
  border-radius: 10px;
}

.l-section-cat-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.l-section-cat-set {
  display: flex;
  align-items: center;
  gap: 15px;
}

.l-section-cat-sort {
  --r: 12px;
  --pad: 12px;
  --bg: #fff;
  --bg-hover: #eaf2ff;
  --bg-active: #e3efff;
  --border: #e6e6e6;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  position: relative;
  display: inline-block;
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Кнопка */
.l-section-cat-sort__btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  user-select: none;
}

.l-section-cat-sort__btn:focus-visible {
  outline: 2px solid #8ab4ff;
  outline-offset: 2px;
}

.l-section-cat-sort__caret {
  transition: transform 0.15s ease;
}

.l-section-cat-sort.is-open .l-section-cat-sort__caret {
  transform: rotate(180deg);
}

/* Меню строго под кнопкой */
.l-section-cat-sort__menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 24px));
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 50;
}

.l-section-cat-sort.is-open .l-section-cat-sort__menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Список и пункты */
.l-section-cat-sort__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.l-section-cat-sort__option {
  padding: 12px var(--pad);
  cursor: pointer;
  white-space: nowrap;
}

.l-section-cat-sort__option:hover {
  background: var(--bg-hover);
}

.l-section-cat-sort__option.is-selected {
  background: var(--bg-active);
}

.l-section-cat-sort__option:focus-visible {
  outline: 2px solid #8ab4ff;
  outline-offset: -2px;
}

@media (max-width: 480px) {
  .l-section-cat-sort__menu {
    min-width: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .l-section-cat-sort__menu,
  .l-section-cat-sort__caret {
    transition: none;
  }
}

/* SECTION CATEGORY FILTER */
/* Контейнер и кнопка */
.l-section-cat-filter { position: relative; }
.l-section-cat-filter__btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--ui-border, #e5e7eb);
  background: #fff; color: #111827; cursor: pointer; line-height: 1;
  position: relative; overflow: hidden;
}
.l-section-cat-filter__btn:hover { background: #f9fafb; }
.l-section-cat-filter__btn[aria-expanded="true"] { border-color: var(--ui-accent, #2563eb); box-shadow: 0 0 0 3px rgb(37 99 235 / 12%); }

.l-section-cat-filter__badge[hidden] { display: none !important; }
.l-section-cat-filter__badge {
  margin-left: 4px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--ui-accent, #2563eb); color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}

/* Меню (sheet) */
.l-section-cat-filter__menu {
  position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 10px);
  width: min(100vw - 32px, 960px); margin: 0 auto;
  background: #fff; border: 1px solid var(--ui-border, #e5e7eb); border-radius: 16px;
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 25%);
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.l-section-cat-filter.is-open .l-section-cat-filter__menu {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}

/* Шапка, тело, подвал */
.lscf__header, .lscf__footer { position: sticky; background: #fff; z-index: 1; }
.lscf__header { top: 0; padding: 14px 16px; border-bottom: 1px solid var(--ui-border, #e5e7eb); display: flex; align-items: center; gap: 12px; }
.lscf__title { font-size: 16px; font-weight: 700; margin: 0; }
.lscf__search { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--ui-border, #e5e7eb); border-radius: 10px; max-width: 320px; width: 100%; }
.lscf__search input { border: 0; outline: 0; width: 100%; font-size: 14px; background: transparent; }

.lscf__body { padding: 14px 16px; max-height: min(70vh, 560px); overflow: auto; display: grid; gap: 18px; }
.lscf__footer { bottom: 0; padding: 12px 16px; border-top: 1px solid var(--ui-border, #e5e7eb); display: flex; justify-content: flex-end; gap: 8px; }

/* Кнопки действий */
.l-section-cat-filter__reset, .l-section-cat-filter__apply {
  appearance: none; border: 1px solid var(--ui-border, #e5e7eb); background: #fff; color: #111827;
  padding: 10px 14px; border-radius: 10px; font-size: 14px; cursor: pointer;
}
.l-section-cat-filter__apply { background: var(--ui-accent, #2563eb); border-color: var(--ui-accent, #2563eb); color: #fff; }
.l-section-cat-filter__reset:hover { background: #f9fafb; }
.l-section-cat-filter__apply:hover { filter: brightness(.97); }

/* Группы */
.lscf-group { display: grid; gap: 10px; }
.lscf-group__title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #4b5563; margin: 0; }

/* ЧЕК-ЛИСТ КАТЕГОРИЙ (кастомный чекбокс единый везде) */
.lscf-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lscf-checklist__item { list-style: none; }

.lscf-check { display: grid; grid-template-columns: 20px 22px 1fr; align-items: center; gap: 10px; cursor: pointer; }
.lscf-check__input {
  appearance: none; width: 18px; height: 18px; margin: 0;
  border: 1.5px solid var(--ui-border, #d1d5db); border-radius: 6px; background: #fff;
  display: grid; place-content: center; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.lscf-check__input:focus-visible { outline: none; box-shadow: 0 0 0 3px rgb(37 99 235 / 25%); }
.lscf-check__input::after {
  content: ""; width: 10px; height: 10px; transform: scale(0); transition: transform .12s ease;
  clip-path: polygon(14% 53%, 0 67%, 35% 100%, 100% 28%, 86% 14%, 35% 76%);
  background: #fff;
}
.lscf-check__input:checked {
  background: var(--ui-accent, #2563eb); border-color: var(--ui-accent, #2563eb);
}
.lscf-check__input:checked::after { transform: scale(1); }

.lscf-check__box { display: none; } /* декоративный спан не нужен при таком подходе */
.lscf-check__ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.lscf-check__ico img { width: 100%; height: 100%; object-fit: contain; }
.lscf-check__ico i { font-size: 18px; color: #111827; }
.lscf-check__label { font-size: 14px; color: #111827; }

.lscf-empty { margin: 6px 0 0; font-size: 13px; color: #6b7280; }

/* ЧИПЫ ДЛЯ ТИПОВ */
.lscf-chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.lscf-chip__input { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; clip-path: inset(50%); }
.lscf-chip {
  display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px;
  border: 1px solid var(--ui-border, #e5e7eb); border-radius: 999px; background: #fff; color: #111827;
  font-size: 14px; line-height: 1; cursor: pointer; user-select: none; transition: border-color .15s, background-color .15s, color .15s;
}
.lscf-chip:hover { background: #f9fafb; }
.lscf-chip__input:checked + .lscf-chip { background: var(--ui-accent, #2563eb); border-color: var(--ui-accent, #2563eb); color: #fff; }

/* Ripple для кнопки */
.l-section-cat-filter__ripple {
  position: absolute; border-radius: 50%; pointer-events: none; opacity: .25;
  transform: scale(0); background: currentColor; animation: lscf-ripple .6s ease-out forwards;
}
@keyframes lscf-ripple { to { transform: scale(1); opacity: 0; } }

/* Мобайл: панель во весь экран */
@media (max-width: 768px) {
  .l-section-cat-filter__menu {
    position: fixed; inset: 12px; width: auto; left: 12px; right: 12px; top: 12px;
  }
}


.l-section-cat-list {
  margin-top: 20px;
}

/* ------------------------------------------------------------------------------- */

/* SECTION CATEGORY ARTICLES*/
.cat-articles-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

/* ------------------------------------------------------------------------------- */

/* SECTION CATEGORY NPA*/
.cat-npa-list {
}

.cat-npa-list-header {
  font-weight: 600;
  font-size: 0.9rem;
  background: #f1f5f9;
  border-radius: 10px;

  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 40px 40px 40px;
  gap: 15px;
  padding: 15px 20px 15px 20px;
  align-items: center;
}

article.item-cat-npa {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 40px 40px 40px;
  gap: 15px;
  padding: 20px;
  align-items: center;
}

.item-cat-npa:hover {
  background: #f9fafc;
  border-radius: 10px;
}

.item-cat-npa-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-npa-title h2 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-npa-type {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-npa-cat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-npa-img {
  max-height: 18px;
}

/* ------------------------------------------------------------------------------- */

/* SECTION CATEGORY DOCUMENTS */
.cat-doc-list {
}

.cat-doc-list-header {
  font-weight: 600;
  font-size: 0.9rem;
  background: #f1f5f9;
  border-radius: 10px;

  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.7fr 0.7fr 40px 40px 40px;
  gap: 15px;
  padding: 15px 20px 15px 20px;
  align-items: center;
}

article.item-cat-doc {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 0.7fr 0.7fr 40px 40px 40px;
  gap: 15px;
  padding: 20px;
  align-items: center;
}

.item-cat-doc:hover {
  background: #f9fafc;
  border-radius: 10px;
}
.item-cat-doc-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-cat-doc-title a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-cat-doc-title h2 {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.item-cat-doc-cat {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-cat-doc-cat a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.item-cat-doc-cat-img {
  max-height: 18px;
}

.item-cat-doc-cat span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-doc-fd {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-cat-doc-type {
  background: #eff6ff;
  color: #3b82f6;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-doc-form {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-doc-form-variant {
  background: #f7dc0b;
}

/* ------------------------------------------------------------------------------- */

/* SECTION CATEGORY TERMS*/
.cat-terms-list {
}

.cat-terms-list-header {
  font-weight: 600;
  font-size: 0.9rem;
  background: #f1f5f9;
  border-radius: 10px;

  display: grid;
  grid-template-columns: 1.5fr 0.9fr 40px 40px 40px;
  gap: 15px;
  padding: 15px 20px 15px 20px;
  align-items: center;
}

article.item-cat-term {
  display: grid;
  grid-template-columns: 1.5fr 0.9fr 40px 40px 40px;
  gap: 15px;
  padding: 20px;
  align-items: center;
}

.item-cat-term:hover {
  background: #f9fafc;
  border-radius: 10px;
}
.item-cat-term-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-cat-term-title a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-cat-term-title h2 {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.item-cat-term-cat {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-cat-term-cat a {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.item-cat-term-cat-img {
  max-height: 18px;
}

.item-cat-term-cat span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-term-fd {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-cat-term-type {
  background: #eff6ff;
  color: #3b82f6;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-term-form {
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-cat-term-form-variant {
  background: #f7dc0b;
}

/* ------------------------------------------------------------------------------- */
